<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>dmeo</title>
</head>

<body>
    <script type='text/javascript'>
        window.jsonpCallback = function (res) {
            console.log(res)
        }
    </script>
    <script src='http://localhost:8080/api/jsonp?msg=hello&cb=jsonpCallback' type='text/javascript'></script>
    <script src="https://cdn.bootcss.com/jquery/3.5.0/jquery.min.js"></script>
    <script>
        $.ajax({
            url: "http://localhost:8080/api/jsonp",
            dataType: "jsonp",
            type: "get",
            data: {
                msg: 'hello'
            },
            jsonp: "cb",
            success: function (data) {
                console.log(data);
            }
        });
    </script>
</body>

</html>